home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / lisp / clue.lha / clue / pcl-patches.l < prev    next >
Lisp/Scheme  |  1989-07-12  |  1KB  |  41 lines

  1. ;;; -*- Mode:Common-Lisp; Package:PCL; Base:10; Patch-file:T -*-
  2.  
  3. ;; These patches make the PCL version dated 8/28/88 (AAAI PCL) work with CLUE
  4.  
  5. (in-package 'xlib :use '(:lisp :pcl))
  6.    
  7. ;;; Use pcl:make-instance* and pcl:initialize-instance*, because
  8. ;;; pcl:make-instance and pcl:initialize-instance assume there are
  9. ;;; no duplicate arguments in the initialization plist.
  10.  
  11. (unexport 'pcl::make-instance 'pcl)
  12. (unexport 'pcl::initialize-instance 'pcl)
  13.    
  14. (export 'xlib::make-instance 'xlib)
  15. (setf (symbol-function 'xlib::make-instance) #'pcl::*make-instance)
  16. (export 'xlib::initialize-instance 'xlib)
  17. (setf (symbol-function 'xlib::initialize-instance) #'pcl::*initialize-instance)
  18.  
  19.  
  20. ;;; Hack pcl so that simple eql specializers in defmethods are evalled.
  21. ;;; Replace this function in pcl/boot.lisp:
  22.  
  23. (defun parse-specializers (specializers)
  24.   (flet ((parse (spec)
  25.        (cond ((symbolp spec)
  26.           (or (find-class spec nil)
  27.               (error
  28.                "~S used as a specializer,~%~
  29.                          but is not the name of a class."
  30.                spec)))
  31.          ((and (listp spec)
  32.                (eq (car spec) 'eql)
  33.                (null (cddr spec)))
  34.           ; jkf fix for eql specializer
  35.           (cond ((and (listp (cadr spec)) 
  36.                   (eq 'quote (car (cadr spec))))
  37.              `(eql ,(cadr (cadr spec))))
  38.             (t spec)))
  39.          (t (error "~S is not a legal specializer." spec)))))
  40.     (mapcar #'parse specializers)))
  41.